package edu.suda.xsap.controller;

import edu.suda.xsap.common.Result;
import edu.suda.xsap.dto.LogDto;
import edu.suda.xsap.dto.Statistics_membercardDto;
import edu.suda.xsap.entity.Statistics_membercard;
import edu.suda.xsap.service.LogService;
import edu.suda.xsap.service.Statistics_membercardService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/log")
@Slf4j
public class WebController {

//    @Autowired
//    private LogService logService;
//
//    @GetMapping("/list")
//    public Result list() {
//        //1. 参数处理
//        //2. 调用业务层方法，并做异常处理
//        try {
//            List<LogDto> logDtos = logService.findAll();
//            //
//            return Result.success(logDtos);
//        } catch (Exception e) {
//            log.error("查询失败", e);
//            return Result.failure(e.getMessage(), e);
//        }
//    }
    @Resource
    Statistics_membercardService statistics_membercardService;

}
